import java.util.Arrays;

public class Test {
    private static int[] arr = {3,5,1,2,123,6,8,20,3};



    public static void main4(String[] args) {
        Sort.countSort(arr);
        Sort.baseSort(arr);
        Sort.bucketSort(arr);
        System.out.println(Arrays.toString(arr));
        int[] arr2 = {10,110,101,1010,11010,1,111};
        Sort.baseSort(arr2, 2);// 二进制排序
        System.out.println(Arrays.toString(arr2));
    }

    public static void main(String[] args) {
        System.out.println("原来的：" + Arrays.toString(arr));
        Sort.mergeSort(arr);
        int[] arr2 = Arrays.copyOf(arr, arr.length);
        Sort.mergeSortNor(arr2);
        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(arr2));
    }

    public static void main2(String[] args) {
        Sort.bubbleSort(arr);
        System.out.println(Arrays.toString(arr));
        int[] arr2 = Arrays.copyOf(arr, arr.length);
//        Sort.quickSortNor(arr2);
        Sort.quickSort(arr2);
        System.out.println(Arrays.toString(arr2));
    }
    public static void main1(String[] args) {
        Sort.selectSort(arr);
        System.out.println(Arrays.toString(arr));
        int[] arr2 = Arrays.copyOf(arr, arr.length);
//        Sort.createHeap(arr2);
//        Sort.heapSort(arr2);
        Sort.shellSort(arr2);
        System.out.println(Arrays.toString(arr2));
    }
}
